<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:insert="~{include :: header('修改设备信息')}" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-device-edit" th:object="${devDevice}">
            <input name="devId" th:field="*{devId}" type="hidden">
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">设备名称：</label>
                    <div class="col-sm-8">
                        <input name="devName" th:field="*{devName}" class="form-control" type="text" required>
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">设备编号：</label>
                    <div class="col-sm-8">
                        <input name="devNumber" th:field="*{devNumber}" class="form-control" type="text" required>
                    </div>
                </div>
            </div>

            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">订阅主题：</label>
                    <div class="col-sm-8">
                        <input name="subscribe" th:field="*{subscribe}" class="form-control" type="text" required>
                    </div>
                </div>
            </div>

            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">发布主题：</label>
                    <div class="col-sm-8">
                        <input name="publish" th:field="*{publish}" class="form-control" type="text" required>
                    </div>
                </div>
            </div>

            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">地址：</label>
                    <div class="col-sm-8">
                        <input name="currentLocation" th:field="*{currentLocation}" class="form-control" type="text" required>
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">纬度：</label>
                    <div class="col-sm-8">
                        <input name="latitude" th:field="*{latitude}" class="form-control" type="text" required>
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">经度：</label>
                    <div class="col-sm-8">
                        <input name="longitude" th:field="*{longitude}" class="form-control" type="text" required>
                    </div>
                </div>
            </div>
        </form>
    </div>
    <th:block th:insert="~{include :: footer}" />
    <script th:inline="javascript">
        var prefix = ctx + "deviceManager/device";
        $("#form-device-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-device-edit').serialize());
            }
        }
    </script>
</body>
</html>